﻿using BCDto.UploadHandleComponent;
using System;
using System.Collections.Generic;
using System.Text;

namespace BCService.UploadHandleComponent
{
    /// <summary>
    /// 上传处理服务接口
    /// </summary>
    public class UploadHandleService : IUploadHandleService
    {
        private readonly IUploadHandleBase uploadHandleBase;
        public UploadHandleService(IUploadHandleBase uploadHandleBase)
        {
            this.uploadHandleBase = uploadHandleBase;
        }

        public void CheckData(UploadFileDto uploadFileDto)
        {
            IUploadHandle uploadHandle = uploadHandleBase.GetHandle(uploadFileDto);
            uploadHandle.CheckData(uploadFileDto);
        }

        public UploadResponseDto UploadHandle(UploadFileDto uploadFileDto)
        {
            IUploadHandle uploadHandle = uploadHandleBase.GetHandle(uploadFileDto);
            return uploadHandle.Process(uploadFileDto);
        }
    }
}
